package com.spring.Repository;

import com.spring.Entity.LogEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;

/**
 * Created by Arabira on 2016/8/3.
 */
@Repository
public interface LogRepository extends JpaRepository<LogEntity, Integer> {

    @Query("from LogEntity l")
    LogEntity[] findLogsAll();

    @Query("from LogEntity l where l.userName like ? and l.ip like ? and l.operation like ? and l.functionTime between ? and ?")
    LogEntity[] findReqLogsAll(String userName, String ip, String operation, Timestamp functionTimeS, Timestamp functionTimeE);
}
